<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>DMDirc</title>
    <style type="text/css">
     td, th, table { border: 1px solid #fff; border-collapse: collapse; padding: 5px; }
     td, tr#t th {
      text-align: center;
      width: 100px;
      overflow: hidden;
     }
     th { width: 150px; text-align: right; }
     td.y { background-color: green; }
     td.n { background-color: red; }
     td.m { background-color: orange; }
     img#logo { float: left;}
     h1 {
      color: #ccd;
      font-family: arial, tahoma, sans-serif;
     }
  </style>
 </head>
 <body>
   <img id="logo" src="res/logo.png" alt="DMDirc logo">
   <h1>DMDirc Feature comparicon matrix</h1>
   <table>
    <tr id="t">
     <td></td>
     <td></td>
   <?php
    chdir('admin');
    require('features-data.php');
    foreach($clients as $clientName) {
     echo '<th>'.$clientName.'</th>'."\n";
    }
    echo '</tr>'."\n";
    foreach($features as $featureGroup => $featureGroupValue) {
    echo '<tr>'."\n".'<th rowspan="'.(count($featureGroupValue)+1).'">'.$featureGroup.'<th>'."\n";
    echo '<td colspan="'.count($clients).'"></td>'."\n";
    echo '</tr>'."\n";
     foreach($featureGroupValue as $featureName => $featureSupportedBy) {
      echo '<tr>'."\n";
      echo '<th>'.$featureName.'</th>'."\n";
       foreach($featureSupportedBy as $clientKey => $featureSupported) {
         if ($featureSupported == '0') {
           echo '<td class="n">No</td>'."\n";
         } else if ($featureSupported == '1') {
           echo '<td class="y">Yes</td>'."\n";
         } else if ($featureSupported == '2') {
           echo '<td class="m">?</td>'."\n";
         }else {
           echo '<td class="m">'.$featureSupported.'</td>'."\n";
         }
       }
      echo '</tr>'."\n";
     }
     echo '<tr>'."\n".'<td></td>'."\n".'</tr>'."\n";
    }
   ?>
   </table>
   <div id="footer">
    <p><a href="/" title="About">Back to about page</a></p>
  </div>
 </body>
</html>
